/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.company.testcenter.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author chandrikar
 */
@Entity
@Table(name="testcenter")
@NamedQuery(name="getAllTestCenters", query="Select t from TestCenter t")
public class TestCenter implements Serializable{

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer testCenterId;
    @Column(length=255,nullable=false)
    private String name;
    @Column(length=255)
    private String location;
    @Column
    private Integer workStationCount;

    @OneToMany(targetEntity=com.company.testcenter.entity.WorkStation.class,mappedBy="testCenter",
                cascade=CascadeType.ALL,fetch=FetchType.EAGER)
    private List<WorkStation> workStations;
    
    public Integer getTestCenterId() {
        return testCenterId;
    }

    public void setTestCenterId(Integer id) {
        this.testCenterId = id;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getWorkStationCount() {
        return workStationCount;
    }

    public void setWorkStationCount(Integer workStationCount) {
        this.workStationCount = workStationCount;
    }

    public List<WorkStation> getWorkStations() {
        return workStations;
    }

    public void setWorkStations(List<WorkStation> workStations) {
        this.workStations = workStations;
    }


    
}
